home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 5 / QRZ Ham Radio Callsign Database - Volume 5.iso / files / mac / mac535.hqx / Mac 535 / stack_-1.xml < prev    next >
Encoding:
Extensible Markup Language  |  1993-03-31  |  16.0 KB  |  16 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in</name>
  5.     <id>-1</id>
  6.     <cardCount>225</cardCount>
  7.     <cardID>5883</cardID>
  8.     <listID>65961</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>on openStack
  17. global Manual, TheDays, Talk, byChannel, SPortGlobals, tempsecs
  18. global onLine, fromRcvr,commanding,instantChannel,flashing, stationList,countryList
  19. global BWCWidth, PBShift
  20. if the version < 2.0 then
  21. answer "This utility requires HyperCard 2.0 or later."
  22. go home
  23. end if
  24. set the userLevel to 5
  25. set lockScreen to true
  26. hide msg
  27. put "-" after menu "File"
  28. put "Quit Mac535" after menu "File" with menuMsgs "doLeave"
  29. create menu "Utils"
  30. put "Write file...,Read file...,Print report..." into menu "Utils"┬¼
  31. with menuMsgs "doWriteFile,doReadFile,doChannelReport"
  32. create menu "Scan"
  33. put "by Frequency...,by Channels...,by Band..." into menu "Scan"┬¼
  34. with menuMsgs "doFreqScan,doChannelScan,doBandScan"
  35. set icon of bg button id 40 to "receiverControl OFF"
  36. set the name of bg button id 40 to "Control OFF"
  37. put true into Manual
  38. put false into commanding
  39. set the name of bg button id 52 to "Following 535"
  40. hide bg button id 52
  41. put false into Talk
  42. put empty into fromRcvr
  43. put false into onLine
  44. put "Sun,Mon,Tue,Wed,Thu,Fri,Sat" into TheDays
  45. configureSPort modemPort,baud4800,data8,stop10,parityOff,stripOn,stripControlsOn,lineFeedsOff
  46. setSPortBufferSize 10240 -- use default buffer
  47. set the highlite of bg btn id 39 to true
  48. set the highlite of bg btn id 55 to true
  49. set the highlite of bg btn id 56 to true
  50. -- load station & countries lists
  51. put empty into stationList
  52. put empty into countryList
  53. repeat with x = 1 to the number of lines of cd field "Station List" of cd "Station Entry"
  54. put item 1 of line x of (cd field "Station List" of cd "Station Entry") & "," after stationList
  55. put item 2 of line x of (cd field "Station List" of cd "Station Entry") & "," after countryList
  56. end repeat
  57. delete the last char of stationList
  58. delete the last char of countryList
  59.  
  60. end openStack
  61.  
  62. on closeStack
  63. if name of bg btn id 40 is "Control ON" then
  64. click at the loc of bg button id 40
  65. end if
  66. reset menuBar
  67. closeSPort
  68. end closeStack
  69.  
  70. on doLeave
  71. sendSPort "H0" & return
  72. reset menuBar
  73. go home
  74. end doLeave
  75.  
  76.  
  77. -- on myEscape
  78. -- reset menubar
  79. -- end myEscape
  80.  
  81.  
  82. on doWriteFile
  83. ask file "Enter name for report file" with "Mac535 Channel List"
  84. if It is empty then
  85. go to card "Main Control Panel"
  86. exit doWriteFile
  87. end if
  88. put It into fileName
  89. open file fileName
  90. visual effect dissolve fast
  91. go to card "Channel000"
  92. repeat with Num = 0 to 199
  93. set cursor to busy
  94. put empty into outRec
  95. put bg fld "channel #" & tab after outRec
  96. put bg fld "Station" & tab after outRec
  97. set cursor to busy
  98. put bg fld "Country" & tab after outRec
  99. put bg fld "kHz" & tab after outRec
  100. put bg fld "Mode" & tab after outRec
  101. set cursor to busy
  102. put bg fld "Bandwidth" & tab after outRec
  103. put bg fld "AGC" & tab after outRec
  104. put bg fld "Attenuator" & tab after outRec
  105. set cursor to busy
  106. put bg fld "Remarks" after outRec
  107. put return after outRec
  108. write outRec to file fileName
  109. set cursor to busy
  110. if Num < 199 then go to next card
  111. add 1 to Num
  112. end repeat
  113. close file fileName
  114. answer "Report completed!" with "Ok"
  115. visual effect dissolve fast
  116. go to card "Main Control Panel"
  117. end doWriteFile
  118.  
  119. on doReadFile
  120. global inChannelRead
  121. answer "This will overwrite the channels currently stored in the stack!  Do you want to do this?" with "Go Ahead" or "Cancel"
  122. if it is "Cancel" then
  123. exit doReadFile
  124. end if
  125. answer file "Enter name of file containing channel data" of type "TEXT"
  126. if the result is not empty then
  127. exit doReadFile
  128. end if
  129. put It into fileName
  130. open file fileName
  131. -- execute this loop until EOF
  132. put True into inChannelRead
  133. go to card "Channel000"
  134. repeat with Num = 0 to 199
  135. read from file fileName until return
  136. if it is empty then
  137. close file fileName
  138. put false into inChannelRead
  139. answer "File read completed!" with "Ok"
  140. visual effect dissolve fast
  141. go to card "Main Control Panel"
  142. exit doReadFile
  143. end if
  144. put it into msg
  145. -- wait until the mouseClick
  146. put char 1 to offset (tab,it) - 1 of it into bg fld "channel #"
  147. delete char 1 to offset (tab,it) of it
  148. put char 1 to offset (tab,it) - 1 of it into bg fld "Station"
  149. delete char 1 to offset (tab,it) of it
  150. put char 1 to offset (tab,it) - 1 of it into bg fld "Country"
  151. delete char 1 to offset (tab,it) of it
  152. put char 1 to offset (tab,it) - 1 of it into bg fld "kHz"
  153. delete char 1 to offset (tab,it) of it
  154. put char 1 to offset (tab,it) - 1 of it into bg fld "Mode"
  155. delete char 1 to offset (tab,it) of it
  156. put char 1 to offset (tab,it) - 1 of it into bg fld "Bandwidth"
  157. delete char 1 to offset (tab,it) of it
  158. put char 1 to offset (tab,it) - 1 of it into bg fld "AGC"
  159. delete char 1 to offset (tab,it) of it
  160. put char 1 to offset (tab,it) - 1 of it into bg fld "Attenuator"
  161. delete char 1 to offset (tab,it) of it
  162. put char 1 to offset (tab,it) - 1 of it into bg fld "Remarks"
  163. if Num < 199 then go to next card of bg "Channel Data"
  164. -- add 1 to Num
  165. end repeat
  166. close file fileName
  167. put false into inChannelRead
  168. answer "File read completed!" with "Ok"
  169. visual effect dissolve fast
  170. go to card "Main Control Panel"
  171. exit doReadFile
  172. end doReadFile
  173.  
  174. on doChannelReport
  175. end doChannelReport
  176.  
  177. -- on do9In
  178. -- set the loc of cd window to 70,70
  179. -- end do9In
  180.  
  181. -- on do19In
  182. -- -- set the loc of cd window to 256,213
  183. -- end do19In
  184.  
  185.  
  186. on doFreqScan
  187. global scanHi,scanLo,scanUp
  188. go to card "Frequency Select"
  189. end doFreqScan
  190.  
  191. on doChannelScan
  192. end doChannelScan
  193.  
  194. on doBandScan
  195. global scanHi,scanLo,scanUp
  196. go to card "Band Select"
  197.  
  198. end doBandScan
  199.  
  200.  
  201. on sendFreq
  202. global commanding
  203. if not commanding then
  204. beep
  205. exit sendFreq
  206. end if
  207. put bg fld "DIAL" of card 1 INTO dialTemp
  208. multiply dialTemp by 1000
  209. set numberFormat to "00000000.#"
  210. sendSPort "F" & dialTemp & return
  211. end sendFreq
  212.  
  213. on doMode
  214. global commanding
  215. if not commanding then
  216. beep
  217. exit doMode
  218. end if
  219. if line 1 of BG FIELD "MODE" of card "Main Control Panel" = "RTTY" then
  220. sendSPort "D0" & return
  221. else if line 1 of BG FIELD "MODE" of card "Main Control Panel" = "CW" then
  222. sendSPort "D1" & return
  223. else if line 1 of BG FIELD "MODE" of card "Main Control Panel" = "USB" then
  224. sendSPort "D2" & return
  225. else if line 1 of BG FIELD "MODE" of card "Main Control Panel" = "LSB" then
  226. sendSPort "D3" & return
  227. else if line 1 of BG FIELD "MODE" of card "Main Control Panel" = "AM" then
  228. sendSPort "D4" & return
  229. else if line 1 of BG FIELD "MODE" of card "Main Control Panel" = "FM" then
  230. sendSPort "D5" & return
  231. else if line 1 of BG FIELD "MODE" of card "Main Control Panel" = "FAX" then
  232. sendSPort "D6"
  233. else if line 1 of BG FIELD "MODE" of card "Main Control Panel" = "ECSS-USB" then
  234. sendSPort "D7" & return
  235. else if line 1 of BG FIELD "MODE" of card "Main Control Panel" = "ECSS-LSB" then
  236. sendSPort "D8" & return
  237. end if
  238. end doMode
  239.  
  240. on doBW
  241. global commanding
  242. if not commanding then
  243. flash 2
  244. exit doBW
  245. end if
  246. if line 1 of BG FIELD FILTER of card "Main Control Panel" = "WIDE" then
  247. sendSPort "B0" & return
  248. else if line 1 of BG FIELD FILTER of card "Main Control Panel" = "INTER" then
  249. sendSPort "B1" & return
  250. else if line 1 of BG FIELD FILTER of card "Main Control Panel" = "NARR" then
  251. sendSPort "B2" & return
  252. else   if line 1 of BG FIELD FILTER of card "Main Control Panel" = "AUX" then
  253. sendSPort "B3" & return
  254. end if
  255. end doBW
  256.  
  257. on doATT
  258. global commanding
  259. if not commanding then
  260. beep
  261. exit doATT
  262. end if
  263. if line 1 of bg field "ATT" of card "Main Control Panel" = "-0 dB" then
  264. sendSPort "A0" & return
  265. else if line 1 of bg field "ATT" of card "Main Control Panel" = "-20 dB" then
  266. sendSPort "A1" & return
  267. end if
  268. end doATT
  269.  
  270. on doAGC
  271. global commanding
  272. if not commanding then
  273. beep
  274. exit doAGC
  275. end if
  276. if line 1 of bg field "AGC" of card "Main Control Panel" = "SLOW" then
  277. sendSPort "G0" & return
  278. else if line 1 of bg field "AGC" of card "Main Control Panel" = "FAST" then
  279. sendSPort "G1" & return
  280. else if line 1 of bg field "AGC" of card "Main Control Panel" = "OFF" then
  281. sendSPort "G2" & return
  282. end if
  283. end doAGC
  284.  
  285. on doBWC
  286. get the rect of bg btn id 70
  287. put item 3 of it - item 1 of it into BWCWidth
  288. set the numberformat to "0000"
  289. put  BWCWidth * 10 into BWCWidth
  290. sendSPort "W" & BWCWidth & return
  291. put BWCWidth && "Hz" into bg field BWCResult
  292. end doBWC
  293.  
  294. on doPBS
  295. global PBShift
  296. set the numberformat to "0000"
  297. put (PBShift * 100) into PBShift
  298. if PBShift >= 0 then
  299. put "+" & PBShift into PBShift
  300. end if
  301. set the name of bg btn id 70 to pbshift
  302. sendSPort "P" & PBShift & return
  303. end doPBS
  304.  
  305.  
  306.  
  307. on enterKey
  308. send mouseUp to bg button "ENTER"
  309. end enterKey
  310.  
  311.  
  312. -- -- -- on Idle
  313. -- -- -- global Manual, TheDays, onLIne, fromRcvr
  314. -- -- -- -- Manual says we've made a change to parameters previously set by
  315. -- -- -- -- a memory channel recall (this makes the "MR" indicator mimic the
  316. -- -- -- -- real one on the 525.
  317. -- -- -- if Manual is true then
  318. -- -- -- put empty into bg field "Mem Recall" of card "Main Control Panel"
  319. -- -- -- else
  320. -- -- -- put "MR" into bg field "Mem Recall" of card "Main Control Panel"
  321. -- -- -- end if
  322. -- -- -- -- update the UTC clock and calendar every 15 seconds
  323. -- -- -- put the seconds into Temp
  324. -- -- -- if Temp mod 15 = 0 then
  325. -- -- -- put Temp + (5*60*60) into TempSecs
  326. -- -- -- set numberFormat to "00"
  327. -- -- -- convert TempSecs to dateItems
  328. -- -- -- put (item 4 of TempSecs *1) & ":" & (item 5 of TempSecs *1) && "UTC" into bg field "UTC Time" of card "Main Control Panel"
  329. -- -- -- put item 7 of TempSecs into Temp
  330. -- -- -- put item Temp of TheDays & " " & item 2 of TempSecs & "/" & item 3 of TempSecs into bg field "UTC Date" of card "Main Control Panel"
  331. -- -- -- end if
  332. -- -- -- -- if any parameters sent from receiver, get then and update display
  333. -- -- -- if onLine then
  334. -- -- -- put recvUpTo(return,0,fromRcvr) into fromRcvr    -- get chars up to a return; don't wait
  335. -- -- -- if fromRcvr is not empty then                    -- there are chars; parse them
  336. -- -- -- if (the last char of fromRcvr) is return then  -- got a complete command
  337. -- -- -- delete the last char of fromRcvr             -- strip the return
  338. -- -- -- put the first char of fromRcvr into theCmd   -- extract the command identifier
  339. -- -- -- put fromRcvr into theParam                   -- put the remainder into parameter
  340. -- -- -- delete the first char of theParam            -- strip the command letter
  341. -- -- -- put empty into fromRcvr                      -- clear for next command
  342. -- -- -- -- determine which command was received & process it
  343. -- -- -- if theCmd is "A" then
  344. -- -- -- if theParam is "0" then
  345. -- -- -- put "-0 dB" into bg fld "Att" of card "Main Control Panel"
  346. -- -- -- else if theParam is "1" then
  347. -- -- -- put "-20 dB" into bg fld "Att" of card "Main Control Panel"
  348. -- -- -- end if
  349. -- -- -- else if theCmd is "B" then
  350. -- -- -- if theParam is "0" then
  351. -- -- -- put "WIDE" into bg fld "Filter" of card "Main Control Panel"
  352. -- -- -- else if theParam is "1" then
  353. -- -- -- put "INTER" into bg fld "Filter" of card "Main Control Panel"
  354. -- -- -- else if theParam is "2" then
  355. -- -- -- put "NARR" into bg fld "Filter" of card "Main Control Panel"
  356. -- -- -- else if theParam is "3" then
  357. -- -- -- put "AUX" into bg fld "Filter" of card "Main Control Panel"
  358. -- -- -- end if
  359. -- -- -- else if theCmd is "C" then
  360. -- -- -- set numberFormat to "000"
  361. -- -- -- put theParam + 0 into bg fld "Channel" of card "Main Control Panel"
  362. -- -- -- else if theCmd is "D" then
  363. -- -- -- if theParam is "0" then
  364. -- -- -- put "RTTY" into bg fld "Mode" of card "Main Control Panel"
  365. -- -- -- else if theParam is "1" then
  366. -- -- -- put "CW" into bg fld "Mode" of card "Main Control Panel"
  367. -- -- -- else if theParam is "2" then
  368. -- -- -- put "USB" into bg fld "Mode" of card "Main Control Panel"
  369. -- -- -- else if theParam is "3" then
  370. -- -- -- put "LSB" into bg fld "Mode" of card "Main Control Panel"
  371. -- -- -- else if theParam is "4" then
  372. -- -- -- put "AM" into bg fld "Mode" of card "Main Control Panel"
  373. -- -- -- else if theParam is "5" then
  374. -- -- -- put "FM" into bg fld "Mode" of card "Main Control Panel"
  375. -- -- -- else if theParam is "6" then
  376. -- -- -- put "FAX" into bg fld "Mode" of card "Main Control Panel"
  377. -- -- -- end if
  378. -- -- -- else if theCmd is "F" then
  379. -- -- -- set numberFormat to "####0.00"
  380. -- -- -- divide theParam by 100
  381. -- -- -- put theParam into bg fld "Dial" of card "Main Control Panel"
  382. -- -- -- else if theCmd is "G" then
  383. -- -- -- if theParam is "0" then
  384. -- -- -- put "SLOW" into bg fld "AGC" of card "Main Control Panel"
  385. -- -- -- else if theParam is "1" then
  386. -- -- -- put "FAST" into bg fld "AGC" of card "Main Control Panel"
  387. -- -- -- else if theParam is "2" then
  388. -- -- -- put "OFF" into bg fld "AGC" of card "Main Control Panel"
  389. -- -- -- end if
  390. -- -- -- else
  391. -- -- -- put "Unknown response: " & theCmd into msg
  392. -- -- -- end if
  393. -- -- -- else
  394. -- -- -- -- save for next idle invocation
  395. -- -- -- end if
  396. -- -- -- end if
  397. -- -- -- end if
  398. -- -- -- end idle
  399.  
  400.  
  401. on Idle
  402. global Manual, TheDays, onLIne, fromRcvr, commanding, tempSecs
  403. -- Manual says we've made a change to parameters previously set by
  404. -- a memory channel recall (this makes the "MR" indicator mimic the
  405. -- real one on the 525.
  406. if Manual is true then
  407. put empty into bg field "Mem Recall" of card "Main Control Panel"
  408. else
  409. put "MR" into bg field "Mem Recall" of card "Main Control Panel"
  410. end if
  411. -- update the UTC clock and calendar every 15 seconds
  412. put the seconds into Temp
  413. if Temp mod 15 = 0 then
  414. put Temp + (4*60*60) into TempSecs ---------***************
  415. set numberFormat to "00"
  416. convert TempSecs to dateItems
  417. put (item 4 of TempSecs *1) & ":" & (item 5 of TempSecs *1) into bg field "UTC Time" of card "Main Control Panel"
  418. put item 7 of TempSecs into Temp
  419. put item Temp of TheDays & " " & item 2 of TempSecs & "/" & item 3 of TempSecs into bg field "UTC Date" of card "Main Control Panel"
  420. end if
  421. -- if any parameters sent from receiver, get then and update display
  422.  
  423. -- ################### "I1" ROUTINE ######################
  424.  
  425. if onLine then
  426. -- following test checks for zillions of chars coming from rcvr in "following"
  427. -- mode.  If more than about one full param set's available, just kill
  428. -- them all and issue a new inquiry.  This keeps the display up-to-date
  429. -- at all times.
  430. if (not commanding) and (charsAvailable() > 30) then
  431. killSPort In
  432. sendSPort "I1" & return
  433. end if
  434. put recvUpTo(return,0,fromRcvr) into fromRcvr    -- get chars up to a return; don't wait
  435. if fromRcvr is not empty then                    -- there are chars; parse them
  436. if (the last char of fromRcvr) is return then  -- got a complete command
  437. delete the last char of fromRcvr             -- strip the return
  438. put the first char of fromRcvr into theCmd   -- extract the command identifier
  439. put fromRcvr into theParam                   -- put the remainder into parameter
  440. delete the first char of theParam            -- strip the command letter
  441. put empty into fromRcvr                      -- clear for next command
  442. -- NOTE: the following code is skipped if we're commanding to keep
  443. --       the receiver's echos from screwing up the display
  444. if not commanding then
  445. -- determine which command was received & process it
  446. if theCmd is "F" then      -- put this first in list 'cause it's the most common
  447. -- put true into Manual
  448. set numberFormat to "####0.000"
  449. divide theParam by 1000
  450. put theParam into bg fld "Dial" of card "Main Control Panel"
  451. else if theCmd is "A" then
  452. -- put true into Manual
  453. if theParam is "0" then
  454. put "-0 dB" into bg fld "Att" of card "Main Control Panel"
  455. else if theParam is "1" then
  456. put "-20 dB" into bg fld "Att" of card "Main Control Panel"
  457. end if
  458. else if theCmd is "B" then
  459. -- put true into Manual
  460. if theParam is "0" then
  461. put "WIDE" into bg fld "Filter" of card "Main Control Panel"
  462. else if theParam is "1" then
  463. put "INTER" into bg fld "Filter" of card "Main Control Panel"
  464. else if theParam is "2" then
  465. put "NARR" into bg fld "Filter" of card "Main Control Panel"
  466. else if theParam is "3" then
  467. put "AUX" into bg fld "Filter" of card "Main Control Panel"
  468. end if
  469. else if theCmd is "C" then   -- ignore to keep from conflicting with OUR chanel
  470. -- put false into Manual
  471. -- set numberFormat to "000"
  472. -- put theParam + 0 into bg fld "Channel"